﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HostsManager.Forms;

namespace HostsManager
{
    public class TrayIconContextMenu : ContextMenu
    {
        internal delegate void ShowFormEventHandler(object sender);
        internal event ShowFormEventHandler ShowForm;

        internal delegate void ExitApplicationEventHandler(object sender);
        internal event ExitApplicationEventHandler ExitApplication;

        public TrayIconContextMenu()
        {
            this.MenuItems.Add(new MenuItem(global::HostsManager.strings.ShowForm, OnShowForm));
            this.MenuItems.Add(new MenuItem("-"));
            this.MenuItems.Add(new MenuItem(global::HostsManager.strings.Exit, OnExitApplication));
        }

        protected void OnShowForm(object sender, EventArgs args)
        {
            if (ShowForm != null)
                ShowForm(this);
        }

        private void OnExitApplication(object sender, EventArgs args)
        {
            if (ExitApplication != null)
                ExitApplication(this);
        }
    }
}
